import request from '@/utils/request'

export function fileCheck (data) {
  return request({
    url: '/v01/user/order/check',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: data
  })
}

export function orderDeposit (data) {
  return request({
    url: '/v01/user/order/deposit',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: data
  })
}

export function doYouyunNetPay (data) {
  return request({
    url: 'http://pay1.youyunnet.com/pay/',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data
  })
}

export function orderCreate (data) {
  return request({
    url: '/v01/user/order/create',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
      // 'cookie': 'userId=1'
    },
    data: data
  })
}

export function orderConfirm (data) {
  return request({
    url: '/v01/user/order/confirm',
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
      // 'cookie': 'userId=1'
    },
    data: data
  })
}

export function singleOrderCreate (data) {
  return request({
    url: '/v01/user/order/create',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    data: data
  })
}

export function getAllOrder (data) {
  return request({
    url: '/v01/user/order/all',
    method: 'get',
    params: data
  })
}

export function getAllOrderDetail (params) {
  return request({
    url: '/v01/user/order_detail/list',
    method: 'get',
    params: params
  })
}

export function exportAllOrderDetail (params) {
  return request({
    url: '/v01/user/order_detail/download/list',
    method: 'get',
    params: params,
    timeout: 0
  })
}
// export function getAllBrand() {
//     return request({
//         url: '/v01/brands/getall',
//         method: 'get'
//     })
// }

